#!/usr/bin/perl -w
use strict;

my @lim;
for(20 .. 35){
	push @lim,[$_,0,0,0,0];
}

my $t = 0;
#pf("in-1.txt");
#pf("in-2.txt");
pf("in-4.txt");

print $t, " ", $t/60,"\n";
for(@lim){
	printf "%d: %4d(%2.0f, %4.0f) %4d(%2.0f, %4.0f)\n", $_->[0],
	$_->[2],
	$_->[1]/($_->[2]||1),
	$t/($_->[2]||1),
	$_->[4],
	$_->[3]/($_->[4]||1),
	$t/($_->[4]||1),
	;
}

sub pf {
	open F,shift;
	while(<F>){
		if(/found e=\s*(\d+)\(100\) c=\s*(\d+)\(100\)/){
			$t++;
			my $e = $1;
			my $c = $2;
			for(@lim){
				if($_->[0] <= $e){
					$_->[1] += $e;
					$_->[2]++;
				}
				if($_->[0] <= $c){
					$_->[3] += $c;
					$_->[4]++;
				}
			}
		}
	}
	close F;
}

